import {Module} from 'vuex'
import request from '@/utils/request'
type CompanyInfo={
	/* 公司vip等级 */
	vip:'vip1'|'vip2'|'vip3'|'',
	/* 运价加价类型：按用户加价1，按企业加价2 */
	rule:0|1|2
}
const companyInfo:Module<CompanyInfo,never>={
	state:{
		vip:'',
		rule:0
	},
	mutations:{
		editCompanyInfo(state,info:CompanyInfo){
			state.vip=info.vip||''
			state.rule=info.rule||0
		},
	},
	actions:{
		getCompanyInfo(context){
			return new Promise((resolve,reject)=>{
				request.get('/api/CurrentEmployee/GetCurrentEmployeeDetailInfo').then(res=>{
					resolve(res)
				})
			})
		}
	},
	namespaced:true
}
export default companyInfo